/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Dsrv6.persistence.entities;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author a381u296
 */
@Entity
@Table(name = "register")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Register.findAll", query = "SELECT r FROM Register r"),
    @NamedQuery(name = "Register.findByRegId", query = "SELECT r FROM Register r WHERE r.regId = :regId"),
    @NamedQuery(name = "Register.findBySurname", query = "SELECT r FROM Register r WHERE r.surname = :surname"),
    @NamedQuery(name = "Register.findByFirstname", query = "SELECT r FROM Register r WHERE r.firstname = :firstname"),
    @NamedQuery(name = "Register.findByFathername", query = "SELECT r FROM Register r WHERE r.fathername = :fathername"),
    @NamedQuery(name = "Register.findByTaxId", query = "SELECT r FROM Register r WHERE r.taxId = :taxId"),
    @NamedQuery(name = "Register.findByBirthDate", query = "SELECT r FROM Register r WHERE r.birthDate = :birthDate"),
    @NamedQuery(name = "Register.findByIdNo", query = "SELECT r FROM Register r WHERE r.idNo = :idNo"),
    @NamedQuery(name = "Register.findByIdDate", query = "SELECT r FROM Register r WHERE r.idDate = :idDate"),
    @NamedQuery(name = "Register.findByIdPlace", query = "SELECT r FROM Register r WHERE r.idPlace = :idPlace"),
    @NamedQuery(name = "Register.findByCitizenCard", query = "SELECT r FROM Register r WHERE r.citizenCard = :citizenCard"),
    @NamedQuery(name = "Register.findByStreet", query = "SELECT r FROM Register r WHERE r.street = :street"),
    @NamedQuery(name = "Register.findByStreetNo", query = "SELECT r FROM Register r WHERE r.streetNo = :streetNo"),
    @NamedQuery(name = "Register.findByZipCode", query = "SELECT r FROM Register r WHERE r.zipCode = :zipCode"),
    @NamedQuery(name = "Register.findByPhoneNo", query = "SELECT r FROM Register r WHERE r.phoneNo = :phoneNo"),
    @NamedQuery(name = "Register.findByMobPhone", query = "SELECT r FROM Register r WHERE r.mobPhone = :mobPhone"),
    @NamedQuery(name = "Register.findByEmail", query = "SELECT r FROM Register r WHERE r.email = :email"),
    @NamedQuery(name = "Register.findByInfoViaInternet", query = "SELECT r FROM Register r WHERE r.infoViaInternet = :infoViaInternet"),
    @NamedQuery(name = "Register.findByAmka", query = "SELECT r FROM Register r WHERE r.amka = :amka"),
    @NamedQuery(name = "Register.findByInsNo", query = "SELECT r FROM Register r WHERE r.insNo = :insNo"),
    @NamedQuery(name = "Register.findByInsLastDate", query = "SELECT r FROM Register r WHERE r.insLastDate = :insLastDate"),
    @NamedQuery(name = "Register.findByCooperative", query = "SELECT r FROM Register r WHERE r.cooperative = :cooperative"),
    @NamedQuery(name = "Register.findByFinancialRefugee", query = "SELECT r FROM Register r WHERE r.financialRefugee = :financialRefugee"),
    @NamedQuery(name = "Register.findByA1G1", query = "SELECT r FROM Register r WHERE r.a1G1 = :a1G1"),
    @NamedQuery(name = "Register.findByIsFarmer", query = "SELECT r FROM Register r WHERE r.isFarmer = :isFarmer"),
    @NamedQuery(name = "Register.findByProtocolNo", query = "SELECT r FROM Register r WHERE r.protocolNo = :protocolNo"),
    @NamedQuery(name = "Register.findByProtocolDate", query = "SELECT r FROM Register r WHERE r.protocolDate = :protocolDate"),
    @NamedQuery(name = "Register.findByIsPrinted", query = "SELECT r FROM Register r WHERE r.isPrinted = :isPrinted"),
    @NamedQuery(name = "Register.findByImpersonate", query = "SELECT r FROM Register r WHERE r.impersonate = :impersonate"),
    @NamedQuery(name = "Register.findByUserMove", query = "SELECT r FROM Register r WHERE r.userMove = :userMove"),
    @NamedQuery(name = "Register.findByDateMove", query = "SELECT r FROM Register r WHERE r.dateMove = :dateMove"),
    @NamedQuery(name = "Register.findByObjection", query = "SELECT r FROM Register r WHERE r.objection = :objection"),
    @NamedQuery(name = "Register.findByIsNewFarmer", query = "SELECT r FROM Register r WHERE r.isNewFarmer = :isNewFarmer"),
    @NamedQuery(name = "Register.findByMAEEflag", query = "SELECT r FROM Register r WHERE r.mAEEflag = :mAEEflag"),
    @NamedQuery(name = "Register.findByKEPYOflag", query = "SELECT r FROM Register r WHERE r.kEPYOflag = :kEPYOflag"),
    @NamedQuery(name = "Register.findByAPASXflag", query = "SELECT r FROM Register r WHERE r.aPASXflag = :aPASXflag"),
    @NamedQuery(name = "Register.findByOGAflag", query = "SELECT r FROM Register r WHERE r.oGAflag = :oGAflag"),
    @NamedQuery(name = "Register.findByUsername", query = "SELECT r FROM Register r WHERE r.username = :username"),
    @NamedQuery(name = "Register.findByLastActionDate", query = "SELECT r FROM Register r WHERE r.lastActionDate = :lastActionDate"),
    @NamedQuery(name = "Register.findByRegistrationDate", query = "SELECT r FROM Register r WHERE r.registrationDate = :registrationDate"),
    @NamedQuery(name = "Register.findByDsrvDate", query = "SELECT r FROM Register r WHERE r.dsrvDate = :dsrvDate"),
    @NamedQuery(name = "Register.findByVersion", query = "SELECT r FROM Register r WHERE r.version = :version")})
public class Register implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "REG_ID")
    private Long regId;
    @Column(name = "SURNAME")
    private String surname;
    @Column(name = "FIRSTNAME")
    private String firstname;
    @Column(name = "FATHERNAME")
    private String fathername;
    @Column(name = "TAX_ID")
    private String taxId;
    @Column(name = "BIRTH_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date birthDate;
    @Column(name = "ID_NO")
    private String idNo;
    @Column(name = "ID_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date idDate;
    @Column(name = "ID_PLACE")
    private String idPlace;
    @Column(name = "CITIZEN_CARD")
    private String citizenCard;
    @Column(name = "STREET")
    private String street;
    @Column(name = "STREET_NO")
    private String streetNo;
    @Column(name = "ZIP_CODE")
    private String zipCode;
    @Column(name = "PHONE_NO")
    private String phoneNo;
    @Column(name = "MOB_PHONE")
    private String mobPhone;
    @Column(name = "EMAIL")
    private String email;
    @Column(name = "INFO_VIA_INTERNET")
    private Boolean infoViaInternet;
    @Column(name = "AMKA")
    private String amka;
    @Column(name = "INS_NO")
    private String insNo;
    @Column(name = "INS_LAST_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date insLastDate;
    @Column(name = "COOPERATIVE")
    private Boolean cooperative;
    @Column(name = "FINANCIAL_REFUGEE")
    private Boolean financialRefugee;
    @Column(name = "A1_G1")
    private Boolean a1G1;
    @Column(name = "IS_FARMER")
    private Boolean isFarmer;
    @Column(name = "PROTOCOL_NO")
    private String protocolNo;
    @Column(name = "PROTOCOL_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date protocolDate;
    @Column(name = "IS_PRINTED")
    private Boolean isPrinted;
    @Column(name = "IMPERSONATE")
    private Boolean impersonate;
    @Column(name = "USER_MOVE")
    private String userMove;
    @Column(name = "DATE_MOVE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateMove;
    @Column(name = "OBJECTION")
    private Boolean objection;
    @Column(name = "IS_NEW_FARMER")
    private Boolean isNewFarmer;
    @Column(name = "MAEE_flag")
    private Boolean mAEEflag;
    @Column(name = "KEPYO_flag")
    private Boolean kEPYOflag;
    @Column(name = "APASX_flag")
    private Boolean aPASXflag;
    @Column(name = "OGA_flag")
    private Boolean oGAflag;
    @Column(name = "USERNAME")
    private String username;
    @Column(name = "LAST_ACTION_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastActionDate;
    @Basic(optional = false)
    @Column(name = "REGISTRATION_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date registrationDate;
    @Column(name = "DSRV_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dsrvDate;
    @Column(name = "VERSION")
    private BigInteger version;
    @JoinColumn(name = "INST_INST_ID", referencedColumnName = "INST_ID")
    @ManyToOne
    private InsuranceType instInstId;
    @JoinColumn(name = "IDT_IDT_ID", referencedColumnName = "IDT_ID")
    @ManyToOne
    private IdType idtIdtId;
    @JoinColumn(name = "GND_GND_ID", referencedColumnName = "GND_ID")
    @ManyToOne
    private Gender gndGndId;
    @JoinColumn(name = "COO_COO_ID", referencedColumnName = "COO_ID")
    @ManyToOne
    private Cooperative cooCooId;

    public Register() {
    }

    public Register(Long regId) {
        this.regId = regId;
    }

    public Register(Long regId, Date registrationDate) {
        this.regId = regId;
        this.registrationDate = registrationDate;
    }

    public Long getRegId() {
        return regId;
    }

    public void setRegId(Long regId) {
        this.regId = regId;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getFathername() {
        return fathername;
    }

    public void setFathername(String fathername) {
        this.fathername = fathername;
    }

    public String getTaxId() {
        return taxId;
    }

    public void setTaxId(String taxId) {
        this.taxId = taxId;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public String getIdNo() {
        return idNo;
    }

    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }

    public Date getIdDate() {
        return idDate;
    }

    public void setIdDate(Date idDate) {
        this.idDate = idDate;
    }

    public String getIdPlace() {
        return idPlace;
    }

    public void setIdPlace(String idPlace) {
        this.idPlace = idPlace;
    }

    public String getCitizenCard() {
        return citizenCard;
    }

    public void setCitizenCard(String citizenCard) {
        this.citizenCard = citizenCard;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getStreetNo() {
        return streetNo;
    }

    public void setStreetNo(String streetNo) {
        this.streetNo = streetNo;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getPhoneNo() {
        return phoneNo;
    }

    public void setPhoneNo(String phoneNo) {
        this.phoneNo = phoneNo;
    }

    public String getMobPhone() {
        return mobPhone;
    }

    public void setMobPhone(String mobPhone) {
        this.mobPhone = mobPhone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Boolean getInfoViaInternet() {
        return infoViaInternet;
    }

    public void setInfoViaInternet(Boolean infoViaInternet) {
        this.infoViaInternet = infoViaInternet;
    }

    public String getAmka() {
        return amka;
    }

    public void setAmka(String amka) {
        this.amka = amka;
    }

    public String getInsNo() {
        return insNo;
    }

    public void setInsNo(String insNo) {
        this.insNo = insNo;
    }

    public Date getInsLastDate() {
        return insLastDate;
    }

    public void setInsLastDate(Date insLastDate) {
        this.insLastDate = insLastDate;
    }

    public Boolean getCooperative() {
        return cooperative;
    }

    public void setCooperative(Boolean cooperative) {
        this.cooperative = cooperative;
    }

    public Boolean getFinancialRefugee() {
        return financialRefugee;
    }

    public void setFinancialRefugee(Boolean financialRefugee) {
        this.financialRefugee = financialRefugee;
    }

    public Boolean getA1G1() {
        return a1G1;
    }

    public void setA1G1(Boolean a1G1) {
        this.a1G1 = a1G1;
    }

    public Boolean getIsFarmer() {
        return isFarmer;
    }

    public void setIsFarmer(Boolean isFarmer) {
        this.isFarmer = isFarmer;
    }

    public String getProtocolNo() {
        return protocolNo;
    }

    public void setProtocolNo(String protocolNo) {
        this.protocolNo = protocolNo;
    }

    public Date getProtocolDate() {
        return protocolDate;
    }

    public void setProtocolDate(Date protocolDate) {
        this.protocolDate = protocolDate;
    }

    public Boolean getIsPrinted() {
        return isPrinted;
    }

    public void setIsPrinted(Boolean isPrinted) {
        this.isPrinted = isPrinted;
    }

    public Boolean getImpersonate() {
        return impersonate;
    }

    public void setImpersonate(Boolean impersonate) {
        this.impersonate = impersonate;
    }

    public String getUserMove() {
        return userMove;
    }

    public void setUserMove(String userMove) {
        this.userMove = userMove;
    }

    public Date getDateMove() {
        return dateMove;
    }

    public void setDateMove(Date dateMove) {
        this.dateMove = dateMove;
    }

    public Boolean getObjection() {
        return objection;
    }

    public void setObjection(Boolean objection) {
        this.objection = objection;
    }

    public Boolean getIsNewFarmer() {
        return isNewFarmer;
    }

    public void setIsNewFarmer(Boolean isNewFarmer) {
        this.isNewFarmer = isNewFarmer;
    }

    public Boolean getMAEEflag() {
        return mAEEflag;
    }

    public void setMAEEflag(Boolean mAEEflag) {
        this.mAEEflag = mAEEflag;
    }

    public Boolean getKEPYOflag() {
        return kEPYOflag;
    }

    public void setKEPYOflag(Boolean kEPYOflag) {
        this.kEPYOflag = kEPYOflag;
    }

    public Boolean getAPASXflag() {
        return aPASXflag;
    }

    public void setAPASXflag(Boolean aPASXflag) {
        this.aPASXflag = aPASXflag;
    }

    public Boolean getOGAflag() {
        return oGAflag;
    }

    public void setOGAflag(Boolean oGAflag) {
        this.oGAflag = oGAflag;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Date getLastActionDate() {
        return lastActionDate;
    }

    public void setLastActionDate(Date lastActionDate) {
        this.lastActionDate = lastActionDate;
    }

    public Date getRegistrationDate() {
        return registrationDate;
    }

    public void setRegistrationDate(Date registrationDate) {
        this.registrationDate = registrationDate;
    }

    public Date getDsrvDate() {
        return dsrvDate;
    }

    public void setDsrvDate(Date dsrvDate) {
        this.dsrvDate = dsrvDate;
    }

    public BigInteger getVersion() {
        return version;
    }

    public void setVersion(BigInteger version) {
        this.version = version;
    }

    public InsuranceType getInstInstId() {
        return instInstId;
    }

    public void setInstInstId(InsuranceType instInstId) {
        this.instInstId = instInstId;
    }

    public IdType getIdtIdtId() {
        return idtIdtId;
    }

    public void setIdtIdtId(IdType idtIdtId) {
        this.idtIdtId = idtIdtId;
    }

    public Gender getGndGndId() {
        return gndGndId;
    }

    public void setGndGndId(Gender gndGndId) {
        this.gndGndId = gndGndId;
    }

    public Cooperative getCooCooId() {
        return cooCooId;
    }

    public void setCooCooId(Cooperative cooCooId) {
        this.cooCooId = cooCooId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (regId != null ? regId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Register)) {
            return false;
        }
        Register other = (Register) object;
        if ((this.regId == null && other.regId != null) || (this.regId != null && !this.regId.equals(other.regId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "maae.persistence.entities.Register[ regId=" + regId + " ]";
    }
    
}
